<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Alpha-欢迎您</title>
    <link rel="shortcut icon" href="icon/title.ico"/>
    <link rel="stylesheet" type="text/css" href="css/index.css">
    <link rel="stylesheet" type="text/css" href="css/bootstrap3.3.7.min.css">

    <script src="js/jquery-1.10.2.min.js"></script>
    <script src="js/bootstrap3.3.7.min.js"></script>
    <script src="js/index.js"></script>
    <style>
        .content{
            width: 80%;margin: auto;}
        html body{font-size:18px;}
        a:hover{text-decoration: none;color:#000;}
        a{ text-decoration:none;}
        a:link {
            text-decoration: none;
        }
    </style>
    <script>
        $(document).ready(function(){
            $(".navbar-nav li").click(function () {
                $(".nav li").each(function () {
                    $(".nav li").attr('class','');
                });
                $(this).attr('class','active');
            })
        })
    </script>
</head>
<body>

<div class="warp">
    <div>
        <h1><a href="javascript:;">Alpha</a></h1>
    </div>
    <nav class="navbar navbar-default"  role="navigation">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse"
                        data-target="#example-navbar-collapse">
                    <span class="sr-only">切换导航</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="#"></a>
            </div>
            <div class="collapse navbar-collapse" id="example-navbar-collapse">
                <ul class="nav navbar-nav">
                    <li class="active"><a href="#">javascript</a></li>
                    <li><a href="#">css</a></li>
                    <li><a href="#">jquery</a></li>
                    <li><a href="#">angular</a></li>
                    <li><a href="works/index2.html">其他</a></li>
                </ul>
            </div>
        </div>
    </nav>
    <div class="img">
        <img src="images/javaScript.png" style=";height: 300px;background:#ccc;" alt="">
    </div>
    <hr>
    <!--返回顶部箭头-->
    <div id="top" style="width: 50px;height: 50px;background-color: #999;position: fixed;right: 50px;bottom:50px;text-align: center;line-height: 50px;display: none;">
        <b>
            <a style="text-decoration:none;color:#fff;;" href="javascript:;">顶部</a>
        </b>
    </div>
    <div class="content">
        <p>
            <a href="code/javascript.html" target="_blank">什么是JavaScript</a>
        </p>
        <p><a target="_blank" href="code/Common.html">常用的css方法</a></p>
        <p>
            <a href="code/arr-repeat.html" target="_blank">JavaScript数组排序和数组去重</a>
        </p>
        <p>
            <a href="code/mobile.html" target="_blank">移动端必用</a>
        </p>
        <p><a href="code/get%20and%20post.html" target="_blank">get和post数据交互:jquery和angular</a></p>
        <p><a target="_blank" href="code/string.html">javaScript的字符操作</a></p>
        <p><a target="_blank" href="code/event.html">JS的各个事件(event)对象</a></p>
        <p><a target="_blank" href="code/jQuery-ajax.html">jQuery的ajax各种方法</a></p>
        <p><a target="_blank" href="code/strange.html">前端诡异元素</a></p>
        <p><a target="_blank" href="code/Storage.html">cookie、localStorage和sessionStorage</a></p>
        <p><a target="_blank" href="code/DOM.html">DOM操作以及使用</a></p>
        <p><a target="_blank" href="code/target-srcElement.html">事件委托原理及用法</a></p>
        <p><a target="_blank" href="code/object.html">面向对象</a></p>
        <p><a target="_blank" href="code/gulp.html">gulp自动化工具</a></p>
        <p><a target="_blank" href="code/form.html">form表单</a></p>
        <p><a target="_blank" href="code/RegExp.html">javaScript正则</a></p>
        <p><a target="_blank" href="code/JumpHTML.html">自动识别手机端页面和PC端页面进行页面跳转</a></p>
        <p><a target="_blank" href="https://alpha0729.github.io/haogongyi/"> 中国好工艺 </a></p>
        <p><a target="_blank" href="code/HTML5Off.html"> HTML5 离线存储 </a></p>
        <p><a target="_blank" href="code/BT.html"> 特殊有趣属性 </a></p>
        <p><a target="_blank" href="code/wall.html"> 穿墙效果 </a></p>
        <p><a target="_blank" href="works/say.html"> 简易留言板 </a></p>
        <p><a target="_blank" href="https://alpha0729.github.io/chaoge/"> 移动端页面自适应作品 </a></p>
    </div>
    <hr>
    <div class="footer">
        <div>
            <img src="" alt="">
            <img src="" alt="">
            <img src="" alt="">
            <img src="" alt="">
            <img src="" alt="">
            <img src="" alt="">
        </div>
        <div class="footer-bottom">
            <p>这是一段内容</p>
        </div>
    </div>
</div>

</body>
</html>
<script>
    window.addEventListener('scroll', function () {
        var oTop=document.getElementById('top');
        var oH=document.documentElement.clientHeight;
        var oS=document.body.scrollTop;
        if(oH+oS>oH){
            oTop.style.display="block";

        }else {
            oTop.style.display="none";
        }
        oTop.onclick= function () {
            var timer=null;
            clearInterval(timer);
            timer=setInterval(function () {
                console.log(oS)
                document.body.scrollTop=(oS*=0.8);
                if (oS<=1){
                    oS=0;
                    clearInterval(timer);
                    oTop.style.display="none";
                    //alert(oS)
                }
                console.log(oS)
            },30)
        }
    },false);
</script>